import org.authsum.stitches.Helper

class ContentVersionControllerTests extends GroovyTestCase {
	def helper

    def stitchesService
	
	void testSaveContentVersion() {
		Long contentDefId = helper.getContentDefId(name:"testSaveContentVersion")
		Long contentId = helper.getContentId(contentDefId:contentDefId,name:"testSaveContentVersion")
		
				Long contentVersionId = helper.getContentVersionId(contentId:contentId)
		
		def controller = new ContentVersionController()
    	controller.stitchesService  = stitchesService
		
		controller.request.parameters = [id:contentVersionId.toString(),name:"testSaveContentVersion"]
		controller.saveContentVersion()
		
	}
	
	void testEditContentVersion() {
		Long contentDefId = helper.getContentDefId(name:"testEditContentVersion")
		Long contentId = helper.getContentId(contentDefId:contentDefId,name:"testEditContentVersion")
		Long contentVersionId = helper.getContentVersionId(contentId:contentId)
		//need to send contentVersionId
		def controller = new ContentVersionController()
    	controller.stitchesService  = stitchesService
		controller.request.parameters = ['contentVersionId':contentVersionId.toString()]
		controller.editContentVersion()
		
	}

}
